

function submitHandler(id, idc){

var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			document.getElementById("isicomment").innerHTML=xmlhttp.responseText;
		}
}
	
	textBox = document.getElementById("TextArea");
	var temp = textBox.value;
	
	
	
	if (textBox.value != "Put Your Comment Here..." && textBox.value != "")
	{
		xmlhttp.open("GET","php/addcomment.php?id="+id+"&idc="+idc+"&isi="+temp,true);
		xmlhttp.send();
	}
	else 
	{
		alert("Can't post empty comment");
	}
	
	update(id);
}


function submitdelete(id,idc){
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			update(id);
		}
}

xmlhttp.open("GET","php/addcomment.php?id=0&idc="+idc+"&isi=",true);
xmlhttp.send();


}


function update(id){
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			document.getElementById("isicomment").innerHTML=xmlhttp.responseText;
		}
}

xmlhttp.open("GET","php/listcomment.php?q="+id,true);
xmlhttp.send();

}


